package com.ss.test04;

/**
 * @Auther: 520ljs
 * @Date: 2022/3/19 - 03 - 19 - 22:23
 */
public class BuyTicketThread implements Runnable{
    int ticketNum = 10;

    @Override
    public void run() {
        for (int i = 1; i <= 100; i++){
            if(ticketNum > 0){
                System.out.println("我在"+Thread.currentThread().getName() + "买到了背景到哈尔滨的第"+ticketNum--+"张车票");
            }
        }
    }
}
